clear
capture log close
cd "C:\Users\rum842\Dropbox\3.3 Madmen\2 Data Paper\Stata Files\Replication Files" // Change to your own directory
set more off
log using "Madman Regressions.log", replace


*************************** DESCRIPTIVE STATISTICS AND BACKGROUND *************************************

* Table A1: Regression Used to Predict Number of Articles
use "Lexis-Nexis Articles with Extra Variables.dta", clear
eststo: tobit total_art leadertime pop rgdppc dem perm_mem eng_lang us i.region i.year, ll(0)
esttab using appendix.rtf, replace b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A1: Tobit Model Used to Predict Expected Articles Per Leader-Year")
eststo clear
predict pred_art, ystar(0,.)

* Table 1: Leaders Most Frequently in Each Category 
use "Leader-Year Crazy Scores.dta", clear
duplicates drop leadid year, force // There are a few leaders who exit and re-enter office in the same year, but all of the variables are coded on a yearly basis, so their entries are exact duplicates.
collapse (sum) reallycrazy15 (mean) crazyscore, by(leader ccode)
gsort -reallycrazy15 -crazyscore
list leader ccode reallycrazy15 crazyscore if reallycrazy15>0

use "Leader-Year Crazy Scores.dta", clear
duplicates drop leadid year, force
collapse (sum) modcrazy15 (mean) crazyscore, by(leadid leader ccode) //Need leadid because of two Bushes in this category.
gsort -modcrazy15 -crazyscore
list leader ccode modcrazy15 crazyscore if modcrazy15>0

* Table A2 and Table A3: Summary Statistics
use "Dyadic Crazy Leader Data.dta", clear
tabstat initMID crazyscore_l1a crazyscore_l1b reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs if pol_rel==1, statistics(mean sd median min max) column(statistics) format(%9.0g)
use "Crazy Leader MID Data", clear
tabstat recip crazyscore_l1a crazyscore_l1b reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, statistics(mean sd median min max) column(statistics) format(%9.0g)

* Figure A1
use "Leader-Year Crazy Scores.dta", clear
_pctile crazyscore_l1 if crazyscore_l1>0, nq(100)
return list
_pctile crazyscore_l1 if crazyscore_l1>0, nq(20)
return list

* Table A5 and Table A6: Check Cook's D Values
use "Dyadic Crazy Leader Data", clear
drop if tpopa<500 | tpopb<500
drop if pol_rel==0
reg initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub
predict d, cooksd
gsort -d
list leadera leaderb year d if _n<=20 

use "Crazy Leader MID Data", clear
drop if tpopa<500 | tpopb<500
reg recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev
predict d, cooksd
gsort -d
list leadera leaderb year dispnum3 d if _n<=20 



*************************** DETERMINANTS OF PERCEIVED MADNESS ******************************

* This is Table A4

use "Leader-Year Crazy Scores.dta", clear
duplicates drop leadid year crazyscore modcrazy15_nolag reallycrazy15_nolag dem gwf_personal realgdp rebel milservice age gender yrs_in_ofc leveledu recentMIDs_byleader gdp_change_l1, force // There are a few leaders who exit and re-enter office in the same year, but all of the variables are coded on a yearly basis, so their entries are exact duplicates.

eststo: tobit crazyscore dem gwf_personal realgdp rebel milservice age gender yrs_in_ofc leveledu recentMIDs_byleader gdp_change_l1, ll(0)
eststo: probit modcrazy15_nolag dem gwf_personal realgdp rebel milservice age gender yrs_in_ofc leveledu recentMIDs_byleader gdp_change_l1, cluster(leadid)
eststo: probit reallycrazy15_nolag dem gwf_personal realgdp rebel milservice age yrs_in_ofc leveledu recentMIDs_byleader gdp_change_l1, cluster(leadid)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A4: Determinants of Perceived Madness")
eststo clear


***************************** GENERAL DETERRENCE RESULTS ********************************************

use "Dyadic Crazy Leader Data", clear
drop if tpopa<500 | tpopb<500

eststo: probit initMID crazyscore_l1a crazyscore_l1b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)

eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
margins, at(modcrazy15b=0 reallycrazy15b=0) saving(file1, replace) 
margins, at(modcrazy15b=1 reallycrazy15b=0) saving(file2, replace)
margins, at(modcrazy15b=0 reallycrazy15b=1) saving(file3, replace)
combomarginsplot file1 file2 file3, recast(bar)
graph save Graph "Deterrence_Dum.gph", replace
// Note: The madness variables all have lags built in.

// It is not clear visually if the difference between the predicted probabilities for no and slight madness reputation is significant, so I test it.
probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
margins, at(modcrazy15b=0 reallycrazy15b=0) at(modcrazy15b=1 reallycrazy15b=0) at(modcrazy15b=0 reallycrazy15b=1) coeflegend post
test _b[1bn._at]=_b[2._at]


***************************** CRISIS BARGAINING RESULTS **********************************************

use "Crazy Leader MID Data", clear
drop if tpopa<500 | tpopb<500

eststo: probit recip crazyscore_l1a crazyscore_l1b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)

eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
margins, at(modcrazy15a=0 reallycrazy15a=0) saving(file1, replace)
margins, at(modcrazy15a=1 reallycrazy15a=0) saving(file2, replace)
margins, at(modcrazy15a=0 reallycrazy15a=1) saving(file3, replace)
combomarginsplot file1 file2 file3, recast(bar)
graph save Graph "Recip_Dum.gph", replace
// Note: The madness variables all have lags built in.

* Generate Table 1
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table 1: Main Results")
eststo clear

* Generate Figure 1
gr combine Deterrence_Dum.gph Recip_Dum.gph
graph save Graph "Figure 1.gph", replace


**************************** INTERACTIONS WITH RELATIVE CAPABILITIES ***************************************

use "Dyadic Crazy Leader Data", clear
drop if tpopa<500 | tpopb<500
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b##c.cincperc modcrazy15b##c.cincperc recentMIDs_byleadera recentMIDs_byleaderb cinca cincb dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
margins, dydx(reallycrazy15b) at(cincperc=(0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1)) noatlegend
marginsplot, recast(line) recastci(rline) addplot (histogram cincperc, bin(20) yaxis(2) below frequency fcolor(none) lcolor(gs14)) title("General Deterrence Model: Marginal Effect of" "Leader B Strong Madness Rep. on Initiation")
graph save Graph "GenDet_Strong.gph", replace
margins, dydx(modcrazy15b) at(cincperc=(0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1)) noatlegend
marginsplot, recast(line) recastci(rline) addplot (histogram cincperc, bin(20) yaxis(2) below frequency fcolor(none) lcolor(gs14)) title("General Deterrence Model: Marginal Effect of" "Leader B Slight Madness Rep. on Initiation")
graph save Graph "GenDet_Slight.gph", replace

use "Crazy Leader MID Data", clear
drop if tpopa<500 | tpopb<500
eststo: probit recip reallycrazy15a##c.cincperc modcrazy15a##c.cincperc reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
margins, dydx(reallycrazy15a) at(cincperc=(0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1)) noatlegend
marginsplot, recast(line) recastci(rline) addplot (histogram cincperc, bin(20) yaxis(2) below frequency fcolor(none) lcolor(gs14)) title("Crisis Bargaining Model: Marginal Effect of" "Leader A Strong Madness Rep. on Reciprocation")
graph save Graph "Crisis_Strong.gph", replace
margins, dydx(modcrazy15a) at(cincperc=(0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1)) noatlegend
marginsplot, recast(line) recastci(rline) addplot (histogram cincperc, bin(20) yaxis(2) below frequency fcolor(none) lcolor(gs14)) title("Crisis Bargaining Model: Marginal Effect of" "Leader A Slight Madness Rep. on Reciprocation")
graph save Graph "Crisis_Slight.gph", replace

// Note: A reallycrazy#modcrazy interaction or a three-way interaction are unnecessary and in fact impossible to include because reallycrazy and modcrazy are mutually exclusive.

* Generage Figure 3 and Table A22
gr combine GenDet_Strong.gph GenDet_Slight.gph Crisis_Strong.gph Crisis_Slight.gph
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A22: Interactions with Relative Capabilities") mtitles("Deterrence" "Crisis Bargaining")
eststo clear

* See which leaders are influencing this.
tab leadera if modcrazy15a==1 & cincperc>.5




**************************** GENERAL DETERRENCE ROBUSTNESS CHECKS ******************************************

use "Dyadic Crazy Leader Data", clear
drop if tpopa<500 | tpopb<500

* Table A7: Deterrence Regressions with Alternate Dummy Madness Measures and Dropping Outliers
eststo: probit initMID reallycrazy5a modcrazy5a reallycrazy5b modcrazy5b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
eststo: probit initMID reallycrazy20a modcrazy20a reallycrazy20b modcrazy20b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
eststo: probit initMID reallycrazy40a modcrazy40a reallycrazy40b modcrazy40b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
eststo: probit initMID crazyscore_l1a crazyscore_l1b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1 & crazyscore_l1b<=0.668460547924041, cluster(dyadid) // This is the 84th percentile value
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A7: Alternate Indicator Cutoffs and Dropping Outliers (Initiation Model)") mtitles("Top 5% Indicator Cutoff" "Top 20% Indicator Cutoff" "Top 40% Indicator Cutoff" "Cont. Measure, Drop Top 16%") 
eststo clear


* Table A8: Address Potential Regional and Time Bias
// Region fixed effects
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub i.regiona i.regionb if pol_rel==1, cluster(dyadid)
//Time Fixed Effects
gen time=1 if year<1991
replace time=2 if year>1990 & year<1995
replace time=3 if year>1994 & year<1999
replace time=4 if year>1998 & year<2003
replace time=5 if year>2002 & year<2007
replace time=6 if year>2006
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub i.time if pol_rel==1, cluster(dyadid)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A8: Address Regional and Time Bias (Initiation Model)") mtitles("Region Fixed Effects" "Time Fixed Effects")
eststo clear 

* Table A9: Address Pro-Western Bias and Strategic Use of Madness Adjectives
// Control for affinity with the US
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b affinity_us_a affinity_us_b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
// Use only non-US sources
eststo: probit initMID reallycrazy15_nousa modcrazy15_nousa reallycrazy15_nousb modcrazy15_nousb recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
// Drop English-Speaking Western Countries
preserve
drop if ccodea<21 | ccodea==200 | ccodea==205 | ccodea==900 | ccodea==920 | ccodeb<21 | ccodeb==200 | ccodeb==205 | ccodeb==900 | ccodeb==920
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
restore
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A9: Address Pro-Western Bias and Strategic Use of Madness Adjectives (Initiation Model)") mtitles("Control for US Affinity" "Only Non-US Sources" "Drop English-Speaking Western Countries")
eststo clear 


* Table A10: Control for and Match on Other Characteristics Associated with Perceived Madness and Control for Reputation.
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b yrs_in_ofc_l1b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1 & yrs_in_ofc_l1b>4, cluster(dyadid)
preserve
drop if reallycrazy15b==. | modcrazy15b==. | yrs_in_ofc_l1b==. | rebel_l1b==. | personalist_l1b==.
gen anycrazyb=(reallycrazy15b==1 | modcrazy15b==1)
drop if pol_rel!=1
cem  westb (.5) personalist_l1b (.5) recentMIDs_stateb (2.5) rebel_l1b (.5) yrs_in_ofc_l1b (4.5 8.5), tr(anycrazyb)
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1 [iweight=cem_weights], cluster(dyadid)
restore
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recent_bluffsa recent_bluffsb recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A10: Address Potentially Confounding Leader and Country Characteristics (Initiation Model)") mtitles("Control for Time in Office" "Drop Leaders in Office <5 Years" "Matched Sample" "Control for Reputation")
eststo clear 

* Table A11: Other Changes to Madness Measure and Comparison with Tough Measure
// Control for tough measure
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b reallytough15b modtough15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
// Use only words used in foreign policy or general context (dropping domestic context).
eststo: probit initMID reallycrazy15_fpa modcrazy15_fpa reallycrazy15_fpb modcrazy15_fpb recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
// Averaging over different time periods
eststo: probit initMID reallycrazy15_avg5a modcrazy15_avg5a reallycrazy15_avg5b modcrazy15_avg5b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
eststo: probit initMID reallycrazy15_avg10a modcrazy15_avg10a reallycrazy15_avg10b modcrazy15_avg10b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A11: Adjustments to the Madness Measure (Initiation Model)") mtitles("Compare to Tough Score" "Drop Words Used outside FP Context" "5-Year Average" "10-Year Average")
eststo clear

* Table A12: Change Sample and DV
// Sample of all dyads
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub, cluster(dyadid)
// Only dyads that have had a MID recently
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if recentMID_nar==1, cluster(dyadid)
// Forceful and Fatal MID dependent variables
eststo: probit initForceMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs_for peaceyrs_for_sq peaceyrs_for_cub if pol_rel==1, cluster(dyadid)
eststo: probit initFatalMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs_fat peaceyrs_fat_sq peaceyrs_fat_cub if pol_rel==1, cluster(dyadid)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A12: Different Sample and Dependent Variables (Initiation Model)") mtitles("No Politically Relevant Restriction" "Only Dyads with a MID in Last 15 Years" "Forceful MID DV" "Fatal MID DV")
eststo clear

* Table A13: Interaction
eststo: probit initMID reallycrazy15a##reallycrazy15b modcrazy15a##modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
margins, at(modcrazy15a=0 reallycrazy15a=0 modcrazy15b=0 reallycrazy15b=0 ) saving(file1, replace)
margins, at(modcrazy15a=0 reallycrazy15a=0 modcrazy15b=1 reallycrazy15b=0 ) saving(file2, replace) 
margins, at(modcrazy15a=1 reallycrazy15a=0 modcrazy15b=0 reallycrazy15b=0 ) saving(file3, replace)
margins, at(modcrazy15a=1 reallycrazy15a=0 modcrazy15b=1 reallycrazy15b=0 ) saving(file4, replace)
combomarginsplot file1 file2 file3 file4, recast(bar)
graph save Graph "Slight_Rep_Interaction_Det.gph", replace
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A13: Interaction (Initiation Model)")
eststo clear 



****************************** CRISIS BARGAINING ROBUSTNESS CHECKS *************************************

use "Crazy Leader MID Data", clear
drop if tpopa<500 | tpopb<500

* Table A14: Compellence Regressions with Alternate Dummy Madness Measures and Dropping Outliers
eststo: probit recip reallycrazy5a modcrazy5a reallycrazy5b modcrazy5b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
eststo: probit recip reallycrazy10a modcrazy10a reallycrazy10b modcrazy10b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
eststo: probit recip reallycrazy20a modcrazy20a reallycrazy20b modcrazy20b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
eststo: probit recip crazyscore_l1a crazyscore_l1b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev if crazyscore_l1a<=3.45738577842712, cluster(ccodea)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A14: Alternate Indicator Cutoffs and Dropping Outliers (Recip Model)") mtitles("Top 5% Indicator Cutoff" "Top 10% Indicator Cutoff" "Top 20% Indicator Cutoff" "Cont. Measure, Dropping Top 1%") 
eststo clear


* Table A15: Address Potential Regional and Time Bias
// Region fixed effects
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev i.regiona i.regionb, cluster(ccodea)
//Time fixed effects
gen time=1 if year<1991
replace time=2 if year>1990 & year<1995
replace time=3 if year>1994 & year<1999
replace time=4 if year>1998 & year<2003
replace time=5 if year>2002 & year<2007
replace time=6 if year>2006
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev i.time, cluster(ccodea)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A15: Address Regional and Time Bias (Recip Model)")  mtitles("Region Fixed Effects" "Time Fixed Effects")
eststo clear

* Table A16: Address Pro-Western Bias and Strategic Use of Madness Adjectives
// Control for affinity with the US
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b affinity_us_a affinity_us_b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
// Use only non-US sources
eststo: probit recip reallycrazy15_nousa modcrazy15_nousa reallycrazy15_nousb modcrazy15_nousb recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
// Drop English-speaking Western countries 
preserve
drop if ccodea<21 | ccodea==200 | ccodea==205 | ccodea==900 | ccodea==920 | ccodeb<21 | ccodeb==200 | ccodeb==205 | ccodeb==900 | ccodeb==920
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
restore
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A16: Address Pro-Western Bias and Strategic Use of Madness Adjectives (Recip Model)")  mtitles("Control for US Affinity" "Only Non-US Sources" "Drop English-Speaking Western Countries")
eststo clear 


* Table A17: Control for and Match on Other Characteristics Associated with Perceived Madness and Control for Reputation
// Control for years in office
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b yrs_in_ofc_l1a recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev if yrs_in_ofc_l1a>4, cluster(ccodea)
// Matching
preserve
drop if reallycrazy15a==. | modcrazy15a==. | yrs_in_ofc_l1a==. | rebel_l1a==. | personalist_l1a==.
gen anycrazya=(reallycrazy15a==1 | modcrazy15a==1)
cem  westa (.5) personalist_l1a (.5) recentMIDs_statea (2.5) rebel_l1a (.5) yrs_in_ofc_l1a (4.5 8.5), tr(anycrazya)
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev [iweight=cem_weights], cluster(ccodea)
restore
// Drop strategic blunders
gen MPtargetMID=((ccodeb==2 | ccodeb==200 | ccodeb==220 | ccodeb==365 | ccodeb==710) & origb==1)
gsort dispn -MPtargetMID
by dispn: replace MPtargetMID=1 if MPtargetMID[_n-1]==1
replace MPtargetMID=0 if MPtargetMID==.
gen MPinitMID=((ccodea==2 | ccodea==200 | ccodea==220 | ccodea==365 | ccodea==710) & origa==1)
gsort dispn -MPinitMID
by dispn: replace MPinitMID=1 if MPinitMID[_n-1]==1
replace MPinitMID=0 if MPinitMID==.
gen blunder=(MPtargetMID==1 & MPinitMID==0)
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev if blunder==0, cluster(ccodea)
//Control for reputation
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recent_bluffsa recent_bluffsb recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A17: Address Potentially Confounding Leader and Country Characteristics (Recip Model)") mtitles("Control for Years in Office" "Drop Leaders in Office <5 Years" "Matched Sample" "Drop Strategic Blunders" "Control for Reputation")
eststo clear


* Table A18: Adjustments to Madness Measure and Comparison with Tough Score
//Compare with tough score
eststo: probit recip reallycrazy15a modcrazy15a reallytough15a modtough15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
// Use only words used in foreign policy context.
eststo: probit recip reallycrazy15_fpa modcrazy15_fpa reallycrazy15_fpb modcrazy15_fpb recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
// Averaging over different time periods
eststo: probit recip reallycrazy15_avg5a modcrazy15_avg5a reallycrazy15_avg5b modcrazy15_avg5b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
eststo: probit recip reallycrazy15_avg10a modcrazy15_avg10a reallycrazy15_avg10b modcrazy15_avg10b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A18: Adjustments to the Madness Measure (Recip Model)")  mtitles("Compare to Tough Score" "Drop Words Used outside FP Context" "5-Year Average" "10-Year Average")
eststo clear


* Table A19: Drop Some MIDs
// Drop MIDs that began with use of force
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev if in1hostlev<4, cluster(ccodea)
// Drop non-revisionist MIDs
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev if nonrev==0, cluster(ccodea)
// Retain only one originator observation per ccodeb in each dispute - because ccodeb holds the recip decision.
preserve
set seed 92478533
gen randomorder=runiform()
gsort -origa +randomorder
duplicates drop dispnum3 ccodeb, force
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
restore
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A19: Dropping Some MIDs (Recip Model)") mtitles("Drop MIDs Beginning with Force" "Drop Non-Revisionist MIDs" "Retain Only One Observation per MID Target")
eststo clear


* Table A20: Interaction
eststo: probit recip reallycrazy15a##reallycrazy15b modcrazy15a##modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A20: Interaction (Recip Model)")
margins, at(modcrazy15a=0 reallycrazy15a=0 modcrazy15b=0 reallycrazy15b=0 ) saving(file1, replace)
margins, at(modcrazy15a=0 reallycrazy15a=0 modcrazy15b=1 reallycrazy15b=0 ) saving(file2, replace) 
margins, at(modcrazy15a=1 reallycrazy15a=0 modcrazy15b=0 reallycrazy15b=0 ) saving(file3, replace)
margins, at(modcrazy15a=1 reallycrazy15a=0 modcrazy15b=1 reallycrazy15b=0 ) saving(file4, replace)
combomarginsplot file1 file2 file3 file4, recast(bar)
graph save Graph "Slight_Rep_Interaction_Recip.gph", replace
eststo clear 

* Table A21: Conflict Selection
use "Dyadic Crazy Leader Data.dta", clear
drop if tpopa<500 | tpopb<500
merge m:1 dispnum3 ccodea ccodeb using "Crazy Leader MID Data.dta", keepusing(recip in1hostlev)
drop if _merge==2 //These are cases in which more than one MID was initiated between the same countries in the same year. Dispum3 in the directed-dyad-year data identifies the most serious dispute, based on hostility and fatality.
assert _merge==3 if initMID==1
drop _merge

eststo: heckprobit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cincperc dema demb jointdem landcontig distance in1hostlev if pol_rel==1, select(initMID=reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub) cluster(ccodea)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) nocon compress label title("Table A21: Conflict Selection Model (Recip Model)")
eststo clear
use "Crazy Leader MID Data", clear

* Note: Table A22 is the capabilities interaction above.



************************************ FOOTNOTES ******************************************************************

* Tables A23 and A24: Results cited in footnotes for deterrence model
use "Dyadic Crazy Leader Data", clear
//Retain tiny countries
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
drop if tpopa<500 | tpopb<500
// Drop extreme outlier
preserve
drop if year==1997 & (ccodea==130 | ccodeb==130) // The high crazy score for Ecuador is actually in 1996, but this is the year that needs dropping because of the lag.
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
restore
// Alternate ways of counting recent previous MID initiations - broader and narrower.
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_statea recentMIDs_stateb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentlossMIDs_byleadera recentlossMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A23: Tests Mentioned in Footnotes (Initiation Model)") mtitles("Retain Tiny Countries" "Drop Extreme Outlier" "Count Recent MIDs by Country" "Count Only Losing Recent MIDs by Leader")
eststo clear
// Minimalist model
eststo: probit initMID reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cincperc jointdem landcontig dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
//Logged measure
gen crazyscore_lna=ln(crazyscore_l1a+1)
gen crazyscore_lnb=ln(crazyscore_l1b+1)
eststo: probit initMID crazyscore_lna crazyscore_lnb recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance dyadlength peaceyrs peaceyrs_sq peaceyrs_cub if pol_rel==1, cluster(dyadid)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A24: More Tests Mentioned in Footnotes (Initiation Model)") mtitles("Minimalist Model" "Logged Madness Measure")
eststo clear

* Tables A25 and A26: Results cited in footnotes for crisis bargaining model
//Retain tiny countries
use "Crazy Leader MID Data", clear
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
drop if tpopa<500 | tpopb<500
// Alternate ways of counting previous MIDs - broader and narrower.
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_statea recentMIDs_stateb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentlossMIDs_byleadera recentlossMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A25: More Tests Mentioned in Footnotes (Recip Model)") mtitles("Retain Tiny Countries" "Count All Recent MIDs" "Count Only Recent Losing MIDs Initiated by Leader")
eststo clear
// Minimalist model
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cincperc dema demb landcontig in1hostlev, cluster(ccodea)
//Logged measure
gen crazyscore_lna=ln(crazyscore_l1a+1)
gen crazyscore_lnb=ln(crazyscore_l1b+1)
eststo: probit recip crazyscore_lna crazyscore_lnb recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodea)
// Cluster by different things
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(leadida)
eststo: probit recip reallycrazy15a modcrazy15a reallycrazy15b modcrazy15b recentMIDs_byleadera recentMIDs_byleaderb cinca cincb cincperc dema demb jointdem landcontig distance in1hostlev, cluster(ccodeb)
esttab using appendix.rtf, append b(3) se(3) lines star(* .10 ** .05 *** .01) compress label title("Table A26: Tests Mentioned in Footnotes (Recip Model)") mtitles("Minimalist Model" "Logged Madness Measure" "Cluster by Leader A" "Cluster by Country B")
eststo clear

